<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <meta name="GENERATOR"
 content="Mozilla/4.6 [en] (WinNT; I) [Netscape]">
  <title>Unix internt</title>
</head>
<body background="marple.gif">
Department of computer science and engineering &nbsp; &nbsp; &nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2010-04-20<br>
Chalmers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Unix internals<br>
ST/AD
<h2>Laboratory Assignment 2 - Processes</h2>
<h3>Purpose</h3>
<ul>
To investigate and get some hands-on experience with Unix processes,
scheduling and process groups.
</ul>
<h3>Assignment:</h3>
<ol>
  <li>What commands are available to get process related information?</li>
  <li>List all processes in the system. Explain (as far as you can) the
purpose of the system related processes.</li>
  <li>What information can you get about a process? What command gives
the most important (most often needed) information?</li>
  <li>Investigate the scheduling (using the programs above) by writing
a small cpu intensive program (wihout I/O) that you can run. What
priority and what percentage of cpu usage do the process get? The
scheduler in Linux is implemented in a different way than the one in
FreeBSD, but this should not affect this assignment very much.<br>
  </li>
  <li>What happens if you run several processes (with the same program)
at the same time? How is the cpu percentage distributed?</li>
  <li>How is the priority affected by the nice value? Can you with two
processes and the <span style="font-style: italic;">nice</span>
command get one to use 60-80%&nbsp; of the CPU-time and the other the
rest?</li>
  <li>The purpose with this and the following assignments is to
investigate process group, session and parent (ppid) for commands.
Execute the command 'cat | sort'. Execute the command 'ps -fj -u
login_name' in another window. Which session, process group and parent do
the processes <span style="font-style: italic;">cat</span> and <span
 style="font-style: italic;">sort</span> have? What other process
belongs to the same session?<br>
  </li>
  <li>Execute the command xterm&amp;. Which new processes have started
and to which session and process group do they belong?</li>
  <li>Execute the command xclock&amp;. Which new processes have started
and to which session, process group and parent do they belong? Which
controlling terminal do they have? Terminate the window&nbsp; in which <span
 style="font-style: italic;">xclock</span> was started. Have parent
process and controlling terminal changed for any of the processes?<br>
  </li>
</ol>
(The processes in exercises 4, 5 and 6 may only be run on your own
computer (not via ssh) to avoid disturbing other users of the computer.
Also take care to terminate all processes when you are finished)<br>
<h3>Reporting:</h3>
<ul>
Written documentation of your results. Exercises 4-6 should be
demonstrated for a course assistant.<br>
  <br>
</ul>
<br>
</body>
</html>
